#ifndef GEOM_HH_
#define GEOM_HH_

namespace Geom {
    template< class T = f8 > class Vector;
    template <class T>
    Vector<T> client_to_server(Vector<T> const& clientVec, Vector<T> size) {
        Vector<T> v = clientVec;
        v.x /= size.x;
        v.y /= size.y;
        v.x *= 2*GALAXY_SIZE;
        v.y *= 2*GALAXY_SIZE;
        v -= Vector<T>(GALAXY_SIZE, GALAXY_SIZE);
        v.y /= -1;
        return v;
    }

    template <class T>
    Vector<T> server_to_client(Vector<T> const& serverVec, Vector<T> size) {
        Vector<T> v = serverVec;
        v.y *= -1;
        v += Vector<T>(GALAXY_SIZE, GALAXY_SIZE);
        v.x /= 2*GALAXY_SIZE;
        v.y /= 2*GALAXY_SIZE;
        v.x *= size.x;
        v.y *= size.y;
        return v;
    }
}

#endif // ndef GEOM_HH_
